use std::error::Error;
pub mod example0;
pub mod example1;


#[derive(Debug)]
struct Thinking<'a> {
    eat_what: String,
    how_many_time_to_finish_the_route: i32,
    if_the_home_address_is_a_pointer_location: &'a i32,
}

impl<'a> Thinking<'a> {
    fn out_pointer(&self) -> i32 {
        self.if_the_home_address_is_a_pointer_location.clone()
    }
}

pub fn main() {
    let location = 111;

    let to_draw_the_thinking = Thinking {
        eat_what: String::from("duck"),
        how_many_time_to_finish_the_route: 3213,
        if_the_home_address_is_a_pointer_location: &location,
    };

    {
        let secret_block = to_draw_the_thinking.out_pointer();
        let secret_block_number_two = to_draw_the_thinking.if_the_home_address_is_a_pointer_location;
        println!("secret_block {}", secret_block);
        println!("secret_block_number_two {}", secret_block_number_two);
    }

    to_draw_the_thinking.if_the_home_address_is_a_pointer_location;

    println!("{:?}",to_draw_the_thinking);
}

// 卧槽跟着编译器复制粘贴就通过了
